package test;
import static tool.print.*;
import java.lang.reflect.*;

import Animal.*;



public class Main
{
    public static void main()
    {
        pln("aaaaa");
        Animal an;
        an = (Animal)Reflect.born("Animal.Cow");
        pln(an.who());
        
        //零例 ， 不能new创建对象 , 直接用类名调用函数
        //Dog t1 = new Dog();
        pln(Dog.getHi());
        
        //Cat t2 = (Cat) Reflect.born("Animal.Cat");
        /*
        Person person = new Person(1, "zs", 20);
        Class<?> cls=person.getClass();
        Method method = cls.getMethod("getName");
        method=cls.getDeclaredMethod("setName", String.class);
        method.setAccessible(true);
        method.invoke(person, "xx");
        */
        
        //Cat cat = (Cat) Reflect.born("Animal.Cat");
        //pln(cat.who());
        /*
        try {
            Class<?> cls = Cat.getClass();
            Method method;
            method = cls.getDeclaredMethod("who");
            method.setAccessible(true);
            method.invoke(cat, null);  
        }catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException   e) {
            }
        */
    }
    
}
